﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;

namespace ModelChecking.ModelValidation.ClearHeightCheck
{
	public class ClearHeightCheckApplication : IExternalApplication
	{
		public Result OnStartup(UIControlledApplication application)
		{
			ClearHeightCheckApplication.m_ThisApp = this;
			this.InitStartXml();
			return Autodesk.Revit.UI.Result.Succeeded;
		}

		public Result OnShutdown(UIControlledApplication application)
		{
			return Autodesk.Revit.UI.Result.Succeeded;
		}

		public void InitStartXml()
		{
			SelectCategrayType selectCategrayType = new SelectCategrayType(this.m_lstAllElement);
			selectCategrayType.initCategoryItemList();
			selectCategrayType.SaveToXmlFile(true);
		}

		public void InitSelectEle(List<Element> lstinputEle)
		{
			this.m_lstAllElement = lstinputEle;
		}

		public static ClearHeightCheckApplication m_ThisApp;

		private List<Element> m_lstAllElement = new List<Element>();
	}
}
